package ch.fusun.baron.printing;

import java.util.List;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.printing.service.impl.GameMessage;

/**
 * Update with the new messages
 */
public class MessagingServiceDataUpdate implements DataUpdate {

	@Inject
	private transient MessagingService service;

	private List<GameMessage> messages;

	/**
	 * Kryo constructor
	 */
	public MessagingServiceDataUpdate() {
	}

	/**
	 * @param messageBuffer
	 *            The messages to be updated
	 */
	public MessagingServiceDataUpdate(List<GameMessage> messageBuffer) {
		this.messages = messageBuffer;
	}

	@Override
	public void update() {
		service.addMessages(messages);
	}

}
